#include "FactoryModRun.h"
#include <QDebug>

#include "Models/ModRunBase.h"

#include "Models/ModRunFactory.h"
#include "Models/ModRunFactoryAbstract.h"
#include "Models/ModRunObserver.h"
#include "Models/ModRunSingleton.h"
#include "Models/ModRunStrategy.h"
#include "Models/ModRunTemplateMethod.h"
#include "Models/ModRunBuilder.h"
#include "Models/ModRunPrototype.h"

//ST_EMCREATE FactoryModRun::_createEntries[emModRunNone] = {};
//std::map<EnumModRun, OnCreateModRun> FactoryModRun::m_mapModRun;

FactoryModRun::FactoryModRun()
{
    qDebug() << "FactoryModRun 单例构造";
}

FactoryModRun::~FactoryModRun()
{
    qDebug() << "FactoryModRun 单例析构";
}

//创建ModRun;
InterFaceModRun* FactoryModRun::CreateModRun(EnumModRun emType)
{
    ST_EMCREATE pCreate = _createEntries[emType];
    if (pCreate.Func)
    {
        qDebug() << emType << ": No Empty";
        return (pCreate.Func)();
    }
    else
    {
        qDebug() << emType << ": Empty";
    }

    //OnCreateModRun pCreate = m_mapModRun[emType];
    //if (nullptr != pCreate)
    //{
    //    return (pCreate)();
    //}
    return nullptr;
}
